﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Browser;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

namespace Jackie.Silverliight.SetpBySetp.Html
{
    public partial class CallScript : Page
    {
        public CallScript()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void submit_Click(object sender, RoutedEventArgs e)
        {
            ScriptObject hello = HtmlPage.Window.GetProperty("Hello") as ScriptObject;
            hello.InvokeSelf(this.input.Text);
        }

        private void createScriptObject_Click(object sender, RoutedEventArgs e)
        {
            ScriptObject scriptObject = HtmlPage.Window.CreateInstance("myHello", this.input.Text);
            scriptObject.Invoke("Display");
        }

    }
}
